CC=g++
export LD_LIBRARY_PATH=/usr/local/lib

all: listener

listener: listener_main.cc
	${CC} -o listener listener_main.cc -DMODELDIR=\"`pkg-config --variable=modeldir pocketsphinx`\" `pkg-config --cflags --libs pocketsphinx sphinxbase`

models:
	text2wfreq < poofy_reference.txt | wfreq2vocab > poofy.vocab
	text2idngram -vocab poofy.vocab -idngram poofy.idngram < poofy_reference.txt
	idngram2lm -vocab_type 1 -idngram poofy.idngram -vocab poofy.vocab  -arpa poofy.arpa
	sphinx_lm_convert -i poofy.arpa -o poofy.DMP